<template>
  <div class="comment">
     <div class="ingo-header">
       <div class="header-more">
         更多
       </div>
       <div class="header-title">用户评价</div>
     </div>
      <div class="user">
        <img :src="comment.userimg" alt="">
        <span>{{comment.username}}</span>
      </div>
    <div>{{comment.connect}}</div>
    <div class="other">
      <span class="data">{{comment.date|show}}</span>
      <span class="style">{{comment.style}}</span>
    </div>
  </div>
</template>

<script>
  export default {
    name: "DetailCommentinfo",
    props:{
      comment:{
        type:Object,
      }
    },
    filters:{
      //如何将时间戳转换成时间
      show(timer){
        //将事件戳转换成Date对象
        const date1=new Date(timer*1000)
        //调用对象的方法
        const time=date1.getFullYear()+"/"+(date1.getMonth()+1)+"/"+date1.getDate();
        return time;
      }
    }
  }
</script>

<style scoped>
.comment{
  padding: 10px;
}
.comment .user img{
  width: 60px;
  height: 60px;
  margin-right: 10px;
  float: left;
}
.comment .user span{
   display: table;
   line-height: 60px;
}
  .comment div:nth-of-type(2){
    margin-top: 10px;
  }
  .header-more{
    float: right;
  }
  .header-title{
    padding-top: 10px;
  }
  .other{
    padding-top: 10px;
  }
  .other .style{
     padding-left: 20px;
  }
</style>
